package com.jx.lcs.thread;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.jx.lcs.common.baidu.BaiduPushUtil;
import com.jx.lcs.usersession.entity.UserSession;

/**
 * 推送消息线程
 */
public class PushMessageThread implements Runnable {

	private static final Logger logger = LoggerFactory.getLogger(PushMessageThread.class);

	private UserSession session;
	
	private String msgContent;
	
	private Integer msgNum;
	
	public PushMessageThread(UserSession session, String msgContent, Integer msgNum) {
		super();
		this.session = session;
		this.msgContent = msgContent;
		this.msgNum = msgNum;
	}

	public void run() {
		try {
			BaiduPushUtil.pushNotification(session.getOs(), session.getBaidu_userId(), session.getBaidu_channelId(), msgContent, msgNum, session.getAppType());
		} catch (Exception e) {
			logger.error("--推送Push出现异常！！", e);
		}
	}

}
